package com.gg.fmallspringboot.controller;

import com.gg.fmallspringboot.Vo.CategoryVo;
import com.gg.fmallspringboot.entity.Category;
import com.gg.fmallspringboot.service.CategoryService;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
@RequestMapping("/category")
public class CategoryController {

    private CategoryService categoryService;

    public CategoryController(CategoryService categoryService) {
        this.categoryService = categoryService;
    }

    @GetMapping
    public List<CategoryVo> getCategoryList(){

        return categoryService.queryCategoryVo();
    }




}
